package top.dopen.demo;

import cn.hutool.core.util.ReUtil;
import org.junit.Test;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Demo1 {
	@Test
	public void fun1(){
		boolean match = ReUtil.isMatch(".*//.*", "//*  aaa */");
		Matcher matcher = Pattern.compile(".*//.*").matcher("//555\n666\b  \\66");
		if(matcher.find()){
			System.out.println(matcher.group());
		}
		System.out.println(match);
	}
	@Test
	public void fun2(){
		boolean match = ReUtil.isMatch(".*//.*", "//*  aaa */");
		Matcher matcher = Pattern.compile("public.+?\\(").matcher("public static void getfunction(User user){}");
		if(matcher.find()){
			System.out.println(matcher.group());
		}
		System.out.println(match);
	}
}
